;======================================================================
;显示光标箭头处理
FC_Cursor_Process
    ;写入文本PPU位置
    LDA <FC_Item_Index
    SEC
    SBC <FC_Page_Cur_Index
    ASL A
    TAY
    
    ;得到文本显示位置
    LDA Game_Name_Pos + 0,Y
    AND #$E0
    STA <FC_Data_Addr_L
    LDA Game_Name_Pos + 1,Y
    AND #$03
    STA <FC_Data_Addr_H
    
    LSR <FC_Data_Addr_H
    ROR <FC_Data_Addr_L
    
    LSR <FC_Data_Addr_H
    ROR <FC_Data_Addr_L
    
    ;光标Y坐标
    LDA <FC_Data_Addr_L
    SEC
    SBC #$01
    CLC
    ADC #$F0 - VSCROLL_OFFSET
    STA OAM_DMA_Buffer + $00
 
    LDA OAM_DMA_Buffer + $00
    CLC
    ADC #GAME_CURSOR_OFFSET_Y
    STA OAM_DMA_Buffer + $00
    
    ;光标Tile
    LDA #GAME_CURSOR_TILE_ID
    STA OAM_DMA_Buffer + $01
    
    ;光标属性
    LDA #$00
    STA OAM_DMA_Buffer + $02
    
    ;光标X坐标
    LDA <FC_Item_Index
    SEC
    SBC <FC_Page_Cur_Index
    ASL A
    TAY
    LDA Game_Name_Pos + 0,Y
    AND #$1F
    ASL A
    ASL A
    ASL A
    SEC
    SBC #08
    STA OAM_DMA_Buffer + $03
    
    LDA OAM_DMA_Buffer + $03
    CLC
    ADC #GAME_CURSOR_OFFSET_X
    STA OAM_DMA_Buffer + $03
    
    ;隐藏光标检查
    LDA FC_Nmi_Task_Flags
    AND #TASK_CURSOR_ENABLE
    BNE .End
    LDA #$F8
    STA OAM_DMA_Buffer + $00
    STA OAM_DMA_Buffer + $03
    
.End
    RTS
